﻿<UserControl x:Class="SABnzbdNET.Views.Settings"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             Loaded="UserControl_Loaded"
             mc:Ignorable="d" d:DesignHeight="350" d:DesignWidth="400">
    <Grid>
    	<Grid.Resources>
		    <DrawingImage x:Key="IconInfo">
		        <DrawingImage.Drawing>
		            <ImageDrawing Rect="0,0,24,24" ImageSource="/SABnzbdNET;component/Graphics/Toolbar/Info.ico" />
		        </DrawingImage.Drawing>
		    </DrawingImage>
		</Grid.Resources>
        <GroupBox Name="grpServer" HorizontalAlignment="Stretch" Height="85" VerticalAlignment="Top" Header="Server settings" >
            <Grid>
                <Label Height="25" Margin="0,0,0,0" Name="lblServerPath" VerticalAlignment="Top" HorizontalAlignment="Left" Width="100">Server address</Label>
                <TextBox Height="25" Margin="100,0,50,0" Name="txtServerPath" VerticalAlignment="Top" Text="{Binding Source={StaticResource Settings}, Path=Default.ServerPath}" />
                <Image Name="imgServerPathInfo" Height="24" Width="24" Stretch="Uniform" Margin="0,0,20,0" VerticalAlignment="Top" HorizontalAlignment="Right" ToolTip="Url of the server. E.g. http://localhost:8080/sabnzbd" Source="{StaticResource IconInfo}"></Image>
                <Label Height="25" Margin="0,30,0,0" Name="lblTimerInterval" VerticalAlignment="Top" HorizontalAlignment="Left" Width="100">Refresh interval</Label>
                <TextBox Height="25" Margin="100,30,0,0" Name="txtTimerInterval" VerticalAlignment="Top" Text="{Binding Source={StaticResource Settings}, Path=Default.TimerInterval}" HorizontalAlignment="Left" Width="30" MaxLength="3"  />
                <Label Height="25" Margin="135,30,0,0" Name="lblTimerIntervalSuffix" VerticalAlignment="Top" HorizontalAlignment="Left" Width="100">minute(s)</Label>
            </Grid>
        </GroupBox>
        <GroupBox Name="grpLogin" HorizontalAlignment="Stretch" Height="115" VerticalAlignment="Top" Header="Login information" Margin="0,95,0,0">
            <Grid>
                <Label Height="25" Margin="0,0,0,0" Name="lblUsername" VerticalAlignment="top" HorizontalAlignment="Left" Width="100">Username</Label>
                <TextBox Height="25" Margin="100,0,200,0" Name="txtUsername" VerticalAlignment="top" Text="{Binding Source={StaticResource Settings}, Path=Default.ServerUsername}" />
                <Label Height="25" Margin="0,30,0,0" Name="lblPassword" VerticalAlignment="top" HorizontalAlignment="Left" Width="100">Password</Label>
                <PasswordBox Height="25" Margin="100,30,200,0" Name="txtPassword" VerticalAlignment="top" />
                <Label Height="25" Margin="0,60,10,0" Name="lblAPIKey" VerticalAlignment="top">API key</Label>
                <TextBox Height="25" Margin="100,60,50,0" Name="txtAPIKey" VerticalAlignment="top" Text="{Binding Source={StaticResource Settings}, Path=Default.ServerAPIKey}" />
                <Image Name="imgAPIKeyInfo" Height="24" Width="24" Stretch="Uniform" Margin="0,60,20,0" VerticalAlignment="Top" HorizontalAlignment="Right" ToolTip="API key found in the generel settings. SABnzd v0.4.9+ only." Source="{StaticResource IconInfo}"></Image>
            </Grid>
        </GroupBox>
    	<GroupBox Name="grpMisc" HorizontalAlignment="Stretch" Height="90" VerticalAlignment="Top" Header="Misc" Margin="0,220,0,0">
            <Grid>
    			<CheckBox Name="chkMinimize" IsChecked="{Binding Source={StaticResource Settings}, Path=Default.MinimizeToTray}" Content="Minimize to tray" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,5,0,0"></CheckBox>
                <CheckBox Name="chkStartMinimized" Content="Start minimized" IsChecked="{Binding Source={StaticResource Settings}, Path=Default.StartMinimized}" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,25,0,0"></CheckBox>
                <CheckBox Name="chkStartup" Content="Run SABnzbdNET at Windows startup" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5,45,0,0"></CheckBox>
            </Grid>
        </GroupBox>
        <Button Height="25" HorizontalAlignment="Right" Margin="0,0,85,0" Name="btnOK" VerticalAlignment="Bottom" Width="75" Click="btnOK_Click">OK</Button>
        <Button Height="25" HorizontalAlignment="Right" Margin="0,0,0,0" Name="btnCancel" VerticalAlignment="Bottom" Width="75" Click="btnCancel_Click">Cancel</Button>
    </Grid>
</UserControl>
